import { GRadioButton } from "../../../../../com/mui/controls/GRadioButton";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { GuildPositionInfo } from "../info/GuildPositionInfo";
//class PositionItem
    
    export  class PositionItem /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=11661567;
            this.selRadio = new GRadioButton();
            this.selRadio.label = "";
            this.selRadio.styleName = "GRadioButton";
            this.addChild(this.selRadio);
            this._nameText = new GTextFiled();
            this._nameText.x = 35;
            this._nameText.y = 0;
            this._nameText.textColor = loc1;
            this.addChild(this._nameText);
            this._numText = new GTextFiled();
            this._numText.x = 90;
            this._numText.y = 0;
            this._numText.textColor = loc1;
            this.addChild(this._numText);
            return;
        }

        public updateByPositionInfo(arg1: GuildPositionInfo): void
        {
            if (arg1) 
            {
                this.selRadio.value = arg1.postion;
                this._nameText.text = arg1.name;
                if (arg1.maxNum == -1) 
                {
                    this._numText.text = arg1.num.toString();
                }
                else 
                {
                    this._numText.text = arg1.num + "/" + arg1.maxNum;
                }
            }
            return;
        }

        public /* var */selRadio: GRadioButton;

        /* internal */ /* var */_nameText: GTextFiled;

        /* internal */ /* var */_numText: GTextFiled;
    }
